home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / amok98-106 / amok98 / programminginoberon / draft1.mod < prev    next >
Text File  |  1993-10-07  |  912b  |  35 lines

  1. MODULE Draft;
  2. (* Very tiny graphics editor, Exercise 12.5, page 241. 
  3.     Note: In Programming in Oberon, this module is called Draw. It
  4.     is renamed to avoid naming conflict with the standard Draw package *)
  5.  
  6. IMPORT Graphs, Shapes,  XYplane, In;
  7. VAR g: Graphs.Graph;
  8.  
  9. PROCEDURE SpanVect(VAR x1, y1, x2, y2: INTEGER);
  10. BEGIN In.Open;  In.Int(x1);  In.Int(y1);  In.Int(x2);  In.Int(y2)
  11. END SpanVect;
  12.  
  13. PROCEDURE Open*;
  14. BEGIN
  15.     XYplane.Open; 
  16.     Shapes.SetClipping(XYplane.X, XYplane.Y, XYplane.W, XYplane.H);
  17.     NEW(g);  Graphs.Open(g);
  18.     Graphs.spanVect := SpanVect
  19. END Open;
  20.  
  21. PROCEDURE DrawAll*;
  22. (* Redraws graphic after part of it was cleared through repositioning of
  23.     title bar or clearing of overlapping viewers *)
  24. BEGIN  
  25.     Shapes.SetClipping(XYplane.X, XYplane.Y, XYplane.W, XYplane.H);
  26.     Graphs.DrawAll(g)
  27. END DrawAll;
  28.  
  29. PROCEDURE New*;
  30. BEGIN Graphs.NewFigure(g)
  31. END New;
  32.  
  33. END Draft.    (* Copyright M. Reiser, 1992 *)
  34.  
  35.